#pragma once

/*
 * 具体 RPC 服务实现
 */

#include <grpcpp/server.h>

#include <memory>

#include "state_machine/StateRpc.h"

class KVStateGrpc : public raft::state_machine::StateRpc {
public:
    // 使用父类构造方法
    using raft::state_machine::StateRpc::StateRpc;

    void start(std::shared_ptr<raft::state_machine::StateMachine> state_machine) override;

    void stop() override;

private:
    std::unique_ptr<grpc::Server> server_;
};